<?php
/**
 * Created by PhpStorm.
 * User: peter
 * Date: 2018/12/5
 * Time: 6:43 PM
 */

namespace app\activity\controller;


use think\Request;

class Area extends Base
{
    /**
     * @purpose 获取区域信息
     * @param Request $request
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function items (Request $request)
    {
        $pid        = $request->get('pid', 0);
        $list       = \app\model\Area::M()
            ->where('pid', $pid)
            ->field('id,pid,name,lng,lat')
            ->order('sort asc')
            ->select();
        return $this->response($list);
    }
}